/******************************************************************************
 * Copyright (c) 2008 Savino Sguera. All rights reserved. 
 *
 * This program and the accompanying materials are made available under the 
 * terms of the Eclipse Public License v1.0, which accompanies this 
 * distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
 *
 * Contributors:
 * 	Savino Sguera < s.sguera@ieee.org >
 ******************************************************************************
 */

package im.agents.contextmanager;

import jade.core.behaviours.CyclicBehaviour;
import jade.lang.acl.*;

/**
 * Questo behavior (ciclico) risponde a messaggi QUERY-REF, inviando 
 * lo stato delle risorse del nodo.
 * @author savino
 * SAVINO LEGGIMI :-D
 * NON l'HO USATO,HO MESSO TUTTI I BEHAVIOUR IN CONTEXTMANAGER
 *
 */
public class GetNodeInfoResponder extends CyclicBehaviour {

	private MessageTemplate getTemplate(){
		/* 
		 * TODO
		 * riceve messaggi che rispettano questo pattern
		 * (per non usare blockingReceive(), che blocca l'agente) 
		 */
		return null;
	}
	@Override
	public void action() {
		ACLMessage msg = myAgent.receive(getTemplate());
		if(msg!=null){
			ACLMessage reply = msg.createReply();
			msg.setPerformative(ACLMessage.INFORM_REF);
			//TODO set content
			myAgent.send(reply);
		}

	}

}
